
//--------------------------------------------------------------------------------------------------------------------------
//	Objet User
//--------------------------------------------------------------------------------------------------------------------------

var connectedUser;
  
User.prototype = {};

function User()
{
	this.login = "";
	this.mdp = "";
	this.isAdmin = false;
	this.serverInterface = new ServerInterface();
	
	this.isLoginOk = User_isLoginOk;
	this.testLogin = User_testLogin;
	this.setDataSource = User_setDataSource;
	
	//Ajout a la liste des GUIDataObjects
	//GUIDataObjects[GUIDataObjects.length]=this;		
}

//--------------------------------------------------------------------------------------------------------------------------

function isUserAdmin()
{
	return false;//connectedUser.isAdmin;
}

//--------------------------------------------------------------------------------------------------------------------------
function User_testLogin(responseFunction)
{
	this.serverInterface.remoteCall("action=testLogin&login="+this.login+"&mdp="+this.mdp,this.id,responseFunction);
}

//--------------------------------------------------------------------------------------------------------------------------
function User_isLoginOk()
{
	if (this.serverInterface.getRemoteData().indexOf("true")>-1)
    {return true;}
	return false; 
}

//--------------------------------------------------------------------------------------------------------------------------
function User_setDataSource(dataSource)
{
	this.serverInterface.setDataSource(dataSource);
}
